package unidad6;

import java.text.NumberFormat;
import java.text.DecimalFormat;
import java.util.Locale;
import java.util.Currency;

public class TestingFormats {

	
	public static void main(String [] args)throws Exception{
		
		Locale.setDefault(Locale.FRANCE);
		NumberFormat nf = NumberFormat.getInstance();
		System.out.println(nf.format(15.25));
		
		
		Locale.setDefault(Locale.ENGLISH);
		DecimalFormat df = new DecimalFormat();
		System.out.println(df.format(15.27));
		
		String sf = "1,588.24";
		
		double a = df.parse(sf.trim()).doubleValue();
		
		System.out.println(a);
		
		
		NumberFormat nf1 = NumberFormat.getCurrencyInstance(Locale.CANADA);
		System.out.println(nf1.format(15.4));
		Currency c = Currency.getInstance(Locale.FRANCE);
		nf1.setCurrency(c);
		System.out.println(nf1.format(15.4));
		
		
		
		
		
	}
}
